package net.devkit.core.pojo.db;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the sys_ur database table.
 * 
 */
@Embeddable
public class SysUrPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String userId;
	private String rolId;

    public SysUrPK() {
    }

	@Column(name="USER_ID", unique=true, nullable=false, length=36)
	public String getUserId() {
		return this.userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}

	@Column(name="ROL_ID", unique=true, nullable=false)
	public String getRolId() {
		return this.rolId;
	}
	public void setRolId(String rolId) {
		this.rolId = rolId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof SysUrPK)) {
			return false;
		}
		SysUrPK castOther = (SysUrPK)other;
		return 
			this.userId.equals(castOther.userId)
			&& this.rolId.equals(castOther.rolId);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.userId.hashCode();
		hash = hash * prime + this.rolId.hashCode();
		
		return hash;
    }
}